#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define int long long
#define endl "\n"

using namespace std;
double a;

signed main() {
	int t;
	cin >> t;
	 
	while(t -- ) {
		cin >> a;
		printf("%.10lf\n", (a + sqrt(a * a + 4)) / 2.0);
		
	}
	return 0;
}

